﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Lin.Library.Web;

namespace Lin.Website.Admin
{
    public partial class VerifyCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var name = WebContext.GetString("VerifName");
            if (name != string.Empty)
            {

                var ncode = new Lin.Library.Web.VerifyCode();
                var codes = ncode.CreateValidateCode(4);
                var bytes = ncode.CreateValidateGraphic(codes);

                Session[name] = codes;
                Response.ClearContent();
                Response.ContentType = WebContext.ContentType(WebContext.Content_Type.jpeg);  //"image/jpeg";
                Response.BinaryWrite(bytes);
            }
        }
    }
}